CC = g++
LIB = -L../lib
INCLUDE = -I../include -I../base -I../network

CFLAG = -DLINUX -DLOG_LEVEL_LITE -DDEBUG -g -c
#CFLAG = -DLOG_LEVEL_HEAVY -c
#PROFILE = -pg
PROFILE = 
OPTIMIZE =
WARNNING = -w
LINKLIB = -ltiny -lpthread -lcurl
TARGET = ../lib/libgarage.a
OBJECTS = BoundaryValue.o CheckFlags.o CmdLine.o FileWorker.o LuaGlue.o TurnNumber.o StateSet.o StateService.o StateNode.o StateLoader.o HttpRequest.o HttpDownload.o

${TARGET} : ${OBJECTS}
	ar r ${TARGET} BoundaryValue.o
	ar r ${TARGET} CheckFlags.o
	ar r ${TARGET} CmdLine.o
	ar r ${TARGET} FileWorker.o
	ar r ${TARGET} LuaGlue.o
	ar r ${TARGET} TurnNumber.o
	ar r ${TARGET} StateSet.o
	ar r ${TARGET} StateService.o
	ar r ${TARGET} StateNode.o
	ar r ${TARGET} StateLoader.o
	ar r ${TARGET} HttpRequest.o
	ar r ${TARGET} HttpDownload.o
	ar t ${TARGET}

BoundaryValue.o : BoundaryValue.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

CheckFlags.o : CheckFlags.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

CmdLine.o : CmdLine.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

LuaGlue.o : LuaGlue.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

FileWorker.o : FileWorker.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp
	
TurnNumber.o : TurnNumber.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp
	
StateSet.o : StateSet.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp
	
StateService.o : StateService.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp
	
StateNode.o : StateNode.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp
	
StateLoader.o : StateLoader.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp
	
HttpRequest.o : HttpRequest.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp

HttpDownload.o : HttpDownload.cpp
	${CC} ${INCLUDE} ${CFLAG} ${PROFILE} ${OPTIMIZE} ${WARNNING} $*.cpp
	
clean :
	rm -rf *.o *.a

new:
	${MAKE} clean
	${MAKE}
